package com.ef.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ef.constant.EClientType;
import com.ef.constant.EIndustryType;
import com.ef.constant.EStageType;
import com.ef.constant.StatusType;

@Entity
public class Company implements Serializable {

	private static final long serialVersionUID = 6148150838725356521L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@Enumerated(value = EnumType.STRING)
	private StatusType status = StatusType.VALID;

	@Column(length = 100)
	private String name;

	@Column(length = 100)
	private String contactor;

	@Column(length = 100)
	private String telephone;

	@Column(length = 100)
	private String email;
	
	@Enumerated(value = EnumType.STRING)
	private EIndustryType industry;
	
	@Enumerated(value = EnumType.STRING)
	private EClientType clientType;

	@Column(length = 200)
	private String address;

	@Column(length = 100)
	private String fax;

	@Column(length = 100)
	private String postCode;

	@Enumerated(value = EnumType.STRING)
	private EStageType stage;

	@ManyToOne(fetch = FetchType.LAZY)
	private User cc;

	@Temporal(TemporalType.TIMESTAMP)
	private Date ccAssignTime;

	@Column(length = 100)
	private Date initialVisitTime;

	@Temporal(TemporalType.DATE)
	private Date opptTime;

	@ManyToOne(fetch = FetchType.LAZY)
	private User updateUser;

	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTime;
	
	/**
	 * 最近的操作时间 指 Call或Demo
	 */
	@Temporal(TemporalType.TIMESTAMP)
	private Date lastEventTime;

	/**
	 * 最近的操作记录 指 Call或Demo
	 */
	@Column(length = 1000)
	private String lastEventCommons;

	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContactor() {
		return contactor;
	}

	public void setContactor(String contactor) {
		this.contactor = contactor;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public StatusType getStatus() {
		return status;
	}

	public void setStatus(StatusType status) {
		this.status = status;
	}

	public EStageType getStage() {
		return stage;
	}

	public void setStage(EStageType stage) {
		this.stage = stage;
	}

	public Date getOpptTime() {
		return opptTime;
	}

	public void setOpptTime(Date opptTime) {
		this.opptTime = opptTime;
	}

	public User getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(User updateUser) {
		this.updateUser = updateUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public User getCc() {
		return cc;
	}

	public void setCc(User cc) {
		this.cc = cc;
	}

	public Date getCcAssignTime() {
		return ccAssignTime;
	}

	public void setCcAssignTime(Date ccAssignTime) {
		this.ccAssignTime = ccAssignTime;
	}

	public Date getLastEventTime() {
		return lastEventTime;
	}

	public void setLastEventTime(Date lastEventTime) {
		this.lastEventTime = lastEventTime;
	}

	public String getLastEventCommons() {
		return lastEventCommons;
	}

	public void setLastEventCommons(String lastEventCommons) {
		this.lastEventCommons = lastEventCommons;
	}

	public Date getInitialVisitTime() {
		return initialVisitTime;
	}

	public void setInitialVisitTime(Date initialVisitTime) {
		this.initialVisitTime = initialVisitTime;
	}

	public EIndustryType getIndustry() {
		return industry;
	}

	public void setIndustry(EIndustryType industry) {
		this.industry = industry;
	}

	public EClientType getClientType() {
		return clientType;
	}

	public void setClientType(EClientType clientType) {
		this.clientType = clientType;
	}

}
